import request from '@/utils/myrequest'
export function getList(kvs) {
  return request({
    url: 'mtms/toolingBasicInfo/getList',
    method: 'get',
    kvs
  })
}

export function add(kvs) {
  return request({
    url: 'mtms/toolingBasicInfo/add',
    method: 'post',
    kvs
  })
}

export function get(kvs) {
  return request({
    url: 'mtms/toolingBasicInfo/get',
    method: 'get',
    kvs
  })
}
export function GetToolingType(kvs) {
  return request({
    url: '/mtms/toolingBasicInfo/GetToolingType',
    method: 'get',
    kvs
  })
}

export function del(kvs) {
  return request({
    url: 'mtms/toolingBasicInfo/delete',
    method: 'post',
    kvs
  })
}

export function edit(kvs) {
  return request({
    url: '/mtms/toolingBasicInfo/Update',
    method: 'post',
    kvs
  })
}

export function initData(data) {
  return request({
    url: '/mtms/toolingBasicInfo/initData',
    method: 'get',
    data
  })
}

export function UpdateToolingImage(data) {
  return request({
    url: 'mtms/toolingBasicInfo/UpdateToolingImage',
    method: 'post',
    data
  })
}

export function GetToolingTypeList(kvs) {
  return request({
    url: '/mtms/toolingBasicInfo/GetToolingTypeList',
    method: 'get',
    kvs
  })
}

// 获取完整的标识位列表
export function GetToolingFlagList(kvs) {
  return request({
    url: 'mtms/toolingBasicInfo/GetToolingFlagList',
    method: 'get',
    kvs
  })
}

// 获取残缺的标识位列表
export function getIncompleteToolingFlagList(kvs) {
  return request({
    url: 'mtms/ToolingBasicInfo/GetToolingFlagForAdd',
    method: 'get',
    kvs
  })
}
// 备件编号
function getToolingInfo(kvs) {
  return request({
    url: '/mtms/ToolingBasicInfo/GetToolingInfo',
    method: 'get',
    kvs
  })
}
// 备件下拉选择框
function getToolingBarcodeList(kvs) {
  return request({
    url: '/mtms/ToolingBasicInfo/GetStockList',
    method: 'get',
    kvs
  })
}
// 备件入库
function enterTooling(kvs) {
  return request({
    url: '/mtms/ToolingBasicInfo/EnterTooling',
    method: 'post',
    kvs
  })
}
// 备件报废
function scrapTooling(kvs) {
  return request({
    url: '/mtms/ToolingBasicInfo/ScrapTooling',
    method: 'post',
    kvs
  })
}
// 借出备件
function lendTooling(kvs) {
  return request({
    url: '/mtms/ToolingBasicInfo/LendTooling',
    method: 'post',
    kvs
  })
}
// 归还备件
function returnTooling(kvs) {
  return request({
    url: '/mtms/ToolingBasicInfo/ReturnTooling',
    method: 'post',
    kvs
  })
}
// 维护备件
function maintainTooling(kvs) {
  return request({
    url: '/mtms/ToolingBasicInfo/MaintainTooling',
    method: 'post',
    kvs
  })
}
// SendBack
function toolingSendBack(kvs) {
  return request({
    url: '/mtms/ToolingBasicInfo/ToolingSendBack',
    method: 'post',
    kvs
  })
}
//
function getToolingForm(kvs) {
  return request({
    url: '/mtms/ToolingBasicInfo/GetToolingInfoForForm',
    method: 'get',
    kvs
  })
}

export function download(kvs) {
  return request({
    url: 'config/download/GetTemplate',
    method: 'get',
    kvs
  })
}

export function toolingLendOnEqp(kvs) {
  return request({
    url: '/mtms/ToolingBasicInfo/ToolingLendOnEqp',
    method: 'POST',
    kvs
  })
}

// 获取备件状态下拉框
function getHDStatus(kvs) {
  return request({
    url: '/mtms/ToolingBasicInfo/GetHDStatus',
    method: 'get',
    kvs
  })
}
export default { getList, get, add, edit, del, initData, UpdateToolingImage, GetToolingTypeList,
  GetToolingFlagList, GetToolingType, maintainTooling,
  getToolingInfo, lendTooling, returnTooling,
  getToolingBarcodeList, enterTooling, scrapTooling, toolingSendBack,
  getToolingForm, download, getIncompleteToolingFlagList, getHDStatus
}

